﻿using LibraryProject.Model;

namespace LibraryProject.Service;

public interface IMongodbService {

    /// <summary>
    /// Query by AccountId
    /// </summary>
    /// <returns>
    /// <see cref="MongodbAccount"/>  or <see langword="null"/>
    /// </returns>
    Task<MongodbAccount?> QueryByAccountId(string accountId);


    /// <summary>
    /// Add account to mongodb
    /// </summary>
    Task AddAccount(string accountId);

    /// <summary>
    /// The <see cref="MongodbAccount.Count"/> of the mongodb database increases
    /// </summary>
    Task IncrementDeviceCount(string accountId, int count);

    /// <summary>
    ///     Update operator by accountId
    /// </summary>
    Task UpdateOperatorByAccountId(string accountId, int deviceId);

    /// <summary>
    ///     Update <see cref="MongodbAccount"/> by <see cref="MongodbAccount.AccountId"/>
    /// </summary>
/// <remarks>
        /// <para>
        ///     target is the name of the attribute to be updated, data is the new value of the attribute
        /// </para>
/// </remarks>
    Task UpdateAttrByAccountId(string accountId, string target, string data);
}